#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

string toHexString(int n);

int main() {

    int n;
    cin >> n;

    string hexStr = toHexString(n);
    cout << hexStr << endl;

    return 0;
}

string toHexString(int n) {
    // write your code here......
    string link="";
    while(n){
        int ret=n%16;  //161%16  1
        if(ret>=0 && ret<=9) {
            char ret1 = ret+'0';
            link+=ret1;
        }
        else if(ret>=10 && ret<=15){
            char ret1 = ret-10+'A'; 
            link+=ret1;
        }
        n/=16;
    }
    reverse(link.begin(), link.end());
    return link;
}   